<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 启动一个定时器，在点击按钮，消除按钮
 -->
 <button id="btn">停下</button>
 <script>
     const btn=document.querySelector('#btn');
     btn.addEventListener('click',()=>{
         console.log(this);
         clearInterval(interval);
     })
     let interval=setInterval(()=>{
        console.log(window.i);
     console.log(this);
         // 箭头函数 简版函数
         console.log(i++);
         //console.log(this.i);

     },3000)
     console.log(interval);//定时器的id 
     let i=1;
     // call
     // 作用域链查找
     //this->window

 </script>
</body>
</html>